package ZuoYe;

public class Multip {
    int real,ins;//实部 虚部
	public  Multip add(Multip multip) {
		int real1=(this.real*multip.real)-(this.ins*multip.ins);
		int ins2=(this.real*multip.ins)+(this.ins*multip.real);
		Multip result=new Multip(real1,ins2);
		return result;
	}

 public Multip(int real, int ins) {
		super();
		this.real = real;
		this.ins = ins;
	}

public void print() {
	if (ins>0) {
		System.out.println("1)" +" F="+real+"+"+ins+"i");
	}else if (ins<0) {
		System.out.println("1)" +" F="+real+""+ins+"i");
	}else {
		System.out.println("1)" +" F="+real);
	}
}

@Override
public String toString() {
	return "Multip [real=" + real + ", ins=" + ins + "]";
}
}
